﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using LM.Negocio.Objetos;

namespace LM.Repositorios.Maps
{
   
    public class VeiculoMap : EntityTypeConfiguration<Veiculo>
    {
        public VeiculoMap()
        { 
            this.HasKey(m => m.Codigo);
            this.Property(m => m.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity).HasColumnName("Id");
            this.Property(m => m.Codigo).HasColumnName("Codigo").IsRequired();
            this.Property(m => m.Cor).HasColumnName("Cor").IsRequired().HasMaxLength(30);
            this.Property(m => m.Ano).HasColumnName("Ano").IsRequired();
            this.Property(m => m.PlacaDoVeiculo).HasColumnName("PlacaDoVeiculo").IsRequired().HasMaxLength(10);
           

            this.ToTable("VEICULO");
        }
    }
}
